package cn.by.wms.entity;

import cn.by.wms.enums.ProductStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Accessors(chain = true)
public class Product extends  BaseEntity {

    private Integer id;
    private String name;
    private String subName;
    private Integer categoryId;
    private String categoryName;
    private Integer status;
    private String statusX;
    private List<String> img ;
    private String brief ;
    private Integer seq ;
    private List<String> tags ;

    public String getStatusX() {
        ProductStatus productStatus = ProductStatus.getProductStatusByCode(this.status);
        if (productStatus !=null){
            return productStatus.getMassage();
        }
        return "";
    }
}
